import { FlowRouter } from 'meteor/kadira:flow-router';
import { BlazeLayout } from 'meteor/kadira:blaze-layout';

// Import needed templates
import '../../ui/layouts/body/body.js';
import '../../ui/layouts/header/header.js';
import '../../ui/layouts/admin_header/admin_header.js';
import '../../ui/pages/home/home.js';
import '../../ui/pages/admin_home/admin_home.js';
import '../../ui/pages/admin_shop_show/admin_shop_show.js';
import '../../ui/pages/login/login.js';
import '../../ui/pages/reg/reg.js';
import '../../ui/pages/apply_shops/apply_shops.js';
import '../../ui/pages/not-found/not-found.js';

// Set up all routes in the app
FlowRouter.route('/', {
  name: 'App.home',
  action() {
    BlazeLayout.render('App_body', {  header: "App_header", main: 'App_home' });
  },
});
FlowRouter.route('/login', {
  name: 'App.login',
  action() {
    BlazeLayout.render('App_body', {  header: "App_header", main: 'App_login_page' });
  },
});

FlowRouter.route('/reg', {
  name: 'App.reg',
  action() {
    BlazeLayout.render('App_body', { header: "App_header", main: 'App_reg_page' });
  },
});
FlowRouter.route('/apply', {
  name: 'App.apply',
  action() {
    BlazeLayout.render('App_body', {  header: "App_header", main: 'apply_shops_page' });
  },
});
FlowRouter.route('/admin', {
  name: 'App.admin',
  action() {
    BlazeLayout.render('App_body', {  header: "App_admin_header", main: 'App_admin_home' });
  },
});

FlowRouter.route('/admin/shop/show/:id', {
  name: 'App.admin.shop.show',
  action(params, queryParams) {
    BlazeLayout.render('App_body', {  header: "App_admin_header", main: 'admin_shop_show' });
  },
});

FlowRouter.notFound = {
  action() {
    BlazeLayout.render('App_body', {  header: "App_header", main: 'App_notFound' });
  },
};
